<%@page import="databank.DatabankVo"%>
<%@page import="java.util.Vector"%>
<%@page import="databank.DataBank"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>list.jsp</title>
<script>
	
	function view(serial) {
		location.href = "index2.jsp?inc_content=./databank/view.jsp&serial="+serial;
	}

	function init() {
		
		document.getElementById('btnFind').onkeyup = function(ev) {
			if (ev.keyCode == 13)
			databank_form.action = 'index2.jsp?inc_content=./databank/list.jsp';
			databank_form.submit();
		};	
		
		
		document.getElementById("upload").onclick = function(){
			location.href = "index2.jsp?inc_content=./databank/upload_form.jsp";
		};
	}
	
</script>
<style type="text/css">
#dGroup1,#dGroup2,#dGroup3,#dGroup4,#dGroup5{
	display: inline-block;
}

#dGroup {
	width: 800px;

	
}

#dGroup1 {
	width: 50px;
	border: 1px solid #aabbcc;
	text-align: center;


}

#dGroup2 {
	width: 200px;
	border: 1px solid #aabbcc;
	text-align: center;
	

}

#dGroup3 {
	width: 220px;
	border: 1px solid #aabbcc;
	text-align: center;



}

#dGroup4 {
	width: 100px;
	border: 1px solid #aabbcc;
	text-align: center;


}
#dGroup5{
	width: 150px;
	border: 1px solid #aabbcc;
	text-align: center;


}
#fGroup1,#fGroup2,#fGroup3,#fGroup4,#fGroup5{
	display: inline-block;
}

#fGroup {
	width: 800px;
	
}

#fGroup1 {
	width: 50px;
	border: 1px solid #aabbcc;
	text-align: center;
	white-space: nowrap;
	text-overflow:ellipsis;
	overflow:hidden;
	


}

#fGroup2 {
	width: 200px;
	border: 1px solid #aabbcc;
	text-align: center;
	white-space: nowrap;
	text-overflow:ellipsis;
	overflow:hidden;
	
	
	
	

}

#fGroup3 {
	width: 220px;
	border: 1px solid #aabbcc;
	text-align: center;
	white-space: nowrap;
	text-overflow:ellipsis;
	overflow:hidden;



}

#fGroup4 {
	width: 100px;
	border: 1px solid #aabbcc;
	text-align: center;
	white-space: nowrap;
	text-overflow:ellipsis;
	overflow:hidden;
	


}
#fGroup5{
	width: 150px;
	border: 1px solid #aabbcc;
	text-align: center;
	white-space: nowrap;
	text-overflow:ellipsis;
	overflow:hidden;
	


}


}


</style>
</head>
<body>
	<jsp:useBean id="bankVo" class="databank.DatabankVo" />
	<jsp:setProperty property="*" name="bankVo" />

	<%
		DataBank bank= new DataBank();
			bank.setVo(bankVo);
			Vector<DatabankVo> v=bank.list();
	%>

	<h1>✦자료실</h1>

	<hr />
	<!-- 검색 -->
	
	<form name='databank_form' action='index2.jsp?inc_content=./databank/list.jsp' method="post">
		<input type="search" name="find" value=<%=bankVo.getFind()%>> 
		<input type="submit" value="검색" id='btnFind' >
		<input type="button" id="upload" value="글쓰기">
	</form>
	<p/>
		<div id="dGroup" >
			<div id="dGroup1" style="background-color:#CEF6EC" >번호</div>
			<div id="dGroup2" style="background-color:#CEF6EC" >제목</div>
			<div id="dGroup3" style="background-color:#CEF6EC" >내용</div>
			<div id="dGroup4" style="background-color:#CEF6EC" >작성자</div>
			<div id="dGroup5" style="background-color:#CEF6EC" >작성일</div>
		</div>
		<p/>

		<!-- DB내용을 검색해서 출력 -->
		<%
			for(int i=0; i<v.size();i++){
			DatabankVo dv = v.get(i);
		%>
		
		<div id="fGroup">
			<div id="fGroup1">
			<%=dv.getSerial()%></div>
			<div id="fGroup2">
				<a href='#' onclick='view(<%=dv.getSerial()%>)'><%=dv.getSubject()%></a></div>
			<div id="fGroup3"><%=dv.getContent()%></div>
			<div id="fGroup4"><%=dv.getMid()%></div>
			<div id="fGroup5"><%=dv.getMdate()%></div> 
				
				
		</div>
		

	<p />
		<%
			}
		%>
	<script>
		init();
	</script>
	

	




</body>
</html>